/*
	Copyright (C) 2010 Salil Bhagurkar

	This file is part of k3

	k3 is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	k3 is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with k3.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <shared.h>

/*Protocol for drivers:
Drivers are supposed to respond to commands from the driver manager.
1. Start driver. Probe devices. If even 1 new device is found, then return success
2. Stop driver. Remove all devices from the system
Hence, start driver can be called at any time. At that point, the driver should detect devices and plug them in the file system
*/

int device_register()
{
	struct fs *devices_fs;
	devices_fs = fs_create(FSFLAGS_DEVICE, "devices");
	fs_link(fsparse_get("/"), devices_fs);

	deviceclass_init();

	register_printk_dev();
	register_keyb();
	register_biosdisk();
	register_serial();

	devicelib_init();

	return 0;
}
